/**
 * 
 */

function Usuario($scope){
	$scope.usuarios = [];
//	                   {
//	                	   firstName:"Daniel",
//		                   secondName:"Souza",
//		                   email:"soudaniel@gmail.com",
//		                   phoneNumber:"(34) 9282-5565",
//		                   sexo:"M"
//		                }
//	                   ];
	
	$scope.add = function(){
		var person = {
						firstName:$scope.firstName,
						secondName:$scope.secondName,
						email:$scope.email,
						phoneNumber:$scope.phoneNumber,
						sexo:$scope.sexo};
		$scope.usuarios.push(person);
		$scope.cadUsuario = true;
	};
	
	$scope.remover = function(usuario){
		$scope.usuarios = $scope.usuarios.filter(function(item){
			if(usuario.firstName != item.firstName){
				$scope.cadUsuario = false;
				return true;
			}
			$scope.cadUsuario = false;
			return false;
		},0);
		
	};
};